<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">

    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no">

    <link rel="stylesheet" href="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/css/bootstrap.min.css">
    <script src="http://cdn.static.runoob.com/libs/jquery/2.1.1/jquery.min.js"></script>
    <script src="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <script src="/task-manager/datePicker.js"></script>
    <title>Title</title>
</head>
<body>
<div class="col-sm-3">
<table class="table table-striped">
    <thead>
    <tr>
        <th>文件名称</th>
         <th>操作</th>
    </tr>
    </thead>
    <tbody id="fileList">
    </tbody>
</table>

<form action="/task-manager/fileList" method="post">

    <input type="text" name="filename" readonly id="filename">
<input  type="file" accept="image/jpeg"/>
<input type="submit" value="上传">
</form>
</div>
</body>
<script>

    var calendar = new datePicker();
    calendar.init({
        'trigger': '#filename', /*按钮选择器，用于触发弹出插件*/
        'type': 'datetime',/*模式：date日期；datetime日期时间；time时间；ym年月；*/
        'minDate':'1900-1-1',/*最小日期*/
        'maxDate':'2100-12-31',/*最大日期*/
        'onSubmit':function(){/*确认时触发事件*/
            var theSelectData=calendar.value;
          },
        'onClose':function(){/*取消时触发事件*/
        }
    });


    $(document).ready(function () {


        $.ajax({
            url: "/task-manager/fileList",
            dataType: 'json',
            type: 'get',
            success: function (data) {
                var html="";
                for(var json  in  data){
                    html+="<tr>\n" +
                        "        <th>"+data[json]+"</th>\n" +
                         "        <th><input type='button' value='删除' </th>\n" +
                        "    </tr>";
                }
                $("#fileList").html(html);
            }
        });
    });
</script>
</html>